ng911ok.tools.validation.validate module#
- synopsis:
Validate Geodatabase
- authors:
Riley Baird (OK), Emma Baker (OK)
- class ValidateGeodatabase#
Bases:
objectClass describing an ArcGIS Python Toolbox tool: “Validate Geodatabase”.
- static _enable_feature_class_parameter(gdb: str, param_dict: dict[str, Parameter])#
- execute(parameters, messages)#
The source code of the tool.
- getParameterInfo()#
Define parameter definitions
- isLicensed()#
Set whether tool is licensed to execute.
- updateMessages(parameters: list[Parameter])#
Modify the messages created by internal validation for each tool parameter. This method is called after internal validation.
- updateParameters(parameters: list[Parameter])#
Modify the values and properties of parameters before internal validation is performed. This method is called whenever a parameter has been changed.
- _all_available_validations_selected(parameters: Sequence[Parameter]) bool#
Returns whether all available routines AND all available feature classes have been selected. This may be
Trueeven if required feature classes are missing. Does not consider therun_allparameter.
- _all_required_validations_selected(parameters: Sequence[Parameter]) bool#
Returns whether all routines AND all required feature classes have been selected. If any required feature classes are missing, this will return
False, even though_all_available_validations_selected()may returnTrue. Does not consider the run_all parameter.
- _gdb_has_rds(gdb: str) bool#
Returns whether gdb contains the required feature dataset (RDS). Uses
@lru_cacheso thatarcpy.ListDatasetsdoes not need to be called every time a parameter is updated. A cache size of 1 is used to ensure that changing the value of gdb will produce a fresh result.
- _get_parameter_index(parameters: Sequence[Parameter], name: str) int#
Given a list of
arcpy.Parameterinstances, returns the index of theParameterin the list with anameattribute equal to name.
- _get_routine_parameters(parameters: Sequence[Parameter]) list[Parameter]#
Given a list of
arcpy.Parameterinstances, returns only those which are for the selection of validation routines.
- _param_set_enabled(parameter: Parameter, enable: bool, *, populate: bool = False, select_all: bool = False) bool#
Sets the
enabledattribute to enable. If enable isFalse, clears thevalueand/orvaluesattributes, if applicable.If populate is
Trueandparameter.enabledis being changed fromFalsetoTrue,ValidationRoutine.populate_parameter_value_table()is called.- Parameters:
parameter (arcpy.Parameter) – The
arcpy.Parameterinstanceenable (bool) – Whether to enable the parameter (if
True) or disable it (ifFalse); default Truepopulate (bool) – Whether to call
ValidationRoutine.populate_parameter_value_table()with parameter. Will only work if parameter is a routine selection parameter (based, in part, on itsnameattribute). Ignored if enable isFalseorparameter.enabledis alreadyTrue. Default False.select_all (bool) – Whether to select all routines in the parameter. Will only work if parameter is a routine selection parameter (based, in part, on its
nameattribute). Ignored if enable isFalse. Default False.
- Returns:
Whether the parameter is enabled or not
- Return type:
bool
- _routine_validate_selection(routine_parameter: Parameter, fc_parameter: Parameter) None#
- get_feature_class_selections(parameters: Sequence[Parameter]) dict[str, bool]#
Returns a
dictof feature classnames and whether each is selected. Only includes the feature classes listed in thefeature_classes_to_checkparameter, which is automatically found among parameters.
- get_routine_selections(parameters: Sequence[Parameter], enabled_only: bool = False) dict[str, bool]#
Returns a
dictof routine names and whether each is selected.